package wiki.kaizen.cloud.plugin.spring.util;

import java.util.HashMap;
import java.util.Map;

public class MapUtil {

    /*
    *
    * */
    public static Map<String,Object> mapKeyToUnderlineName(Map<String,Object> map){

        if (map.size()>0){
            Map<String,Object> newMap = new HashMap<>();
            for (Map.Entry<String, Object> next : map.entrySet()) {
                newMap.put(TableNameUtil.camelToColumnUnderline(next.getKey()), next.getValue());
            }
            return newMap;
        }
        return map;
    }

    public static Map<String,Object> singleMap(String key,Object value){
        return new HashMap<String,Object>(){
            {
                put(key,value);
            }
        };
    }
}
